# Sum series

num=1000
sum = 0
for i in range(1,num+1):
  sum += pow(i, i)

print sum%10**10
